package models

import (
	"time"
	"github.com/astaxie/beego/orm"
)

type Article struct {
	Id           int
	Title        string        `ht:"list;search;name(标题)"`
	Author       string                `ht:"list;name(作者)"`
	EditTime     time.Time        `ht:"list;name(编辑时间);defaultvalue(time.Now())"`
	CreateTime   time.Time                `ht:"hide;defaultvalue(time.Now())"`
	Introduction string                `ht:"list;name(简介)"`
	ListPicPath  string 	`ht:"name(列表页图片);type(pic)"`
	Content      string `orm:"type(text)" ht:"type(mutitext);name(内容)"`
	ArticleType  int `ht:"list;subclass([{\"Num\":0,\"Name\":\"活动咨询\"},{\"Num\":1,\"Name\":\"作品选登\"},{\"Num\":2,\"Name\":\"天使风采\"},{\"Num\":3,\"Name\":\"读书会简介\"},{\"Num\":4,\"Name\":\"读书会活动\"},{\"Num\":5,\"Name\":\"书香讲堂\"},{\"Num\":6,\"Name\":\"天下书坊\"},{\"Num\":7,\"Name\":\"家生活\"},{\"Num\":8,\"Name\":\"书坊创意设计\"}]);name(类型)"`
	CommentOrNot int `ht:"name(是否可评论);enum([{\"Key\":\"0\",\"Value\":\"不可评论\"},{\"Key\":\"1\",\"Value\":\"可评论\"}])"`
	Status       int `ht:"list;status([{\"Num\":0,\"Name\":\"未审核\"},{\"Num\":1,\"Name\":\"删除\"},{\"Num\":2,\"Name\":\"初审\"},{\"Num\":3,\"Name\":\"发布\"}]);name(状态)"` //0:init;1:delete;2:publish
	RecommendToUserApear int
	BrowseCount  int        `ht:"list;name(浏览人数)"`
	StartCount   int        `ht:"list;name(点赞人数)"`
	WatchCount   int        `ht:"list;name(收藏人数)"`
	OnlineEnroll	int 	`ht:"list;name(线上报名);enum([{\"Key\":\"0\",\"Value\":\"是\"},{\"Key\":\"1\",\"Value\":\"否\"}])"`
	GoodsHref    string 	`ht:"name(活动交费链接)"`
	UserId       int        `ht:"hide;name(发表者Id)"`
	CityId       int        `ht:"hide;name(所在地Id)"`
}

//type
//0 活动咨询
//1 作品选登
//2 天使风采
//3 读书会简介
//4 读书会活动
//5 书香讲堂
//6 天下书坊
//7 家生活
//8 书坊创意设计

type status int

func init() {
	orm.RegisterModel(new(Article))
}
func (*Article)TableName() string {
	return "article"
}

func (*Article) FN_Id() string {
	return "Id"
}
func (*Article) FN_Title() string {
	return "Title"
}
func (*Article) FN_Author() string {
	return "Author"
}
func (*Article) FN_EditTime() string {
	return "EditTime"
}
func (*Article) FN_CreateTime() string {
	return "CreateTime"
}
func (*Article) FN_Introduction() string {
	return "Introduction"
}
func (*Article) FN_Content() string {
	return "Content"
}
func (*Article) FN_ArticleType() string {
	return "ArticleType"
}
func (*Article) FN_CommentOrNot() string {
	return "CommentOrNot"
}
func (*Article) FN_Status() string {
	return "Status"
}
func (*Article) FN_BrowseCount() string {
	return "BrowseCount"
}
func (*Article) FN_StartCount() string {
	return "StartCount"
}
func (*Article) FN_WatchCount() string {
	return "WatchCount"
}
func (*Article) FN_UserId() string {
	return "UserId"
}
func (*Article) FN_CityId() string {
	return "CityId"
}